<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration {
    /**
     * Run the migrations.
     */
    public function up()
    : void
    {
        Schema::create('qnr_tags',function(Blueprint $table) {

            // 数据类型
            $table->engine = 'InnoDB';

            $table->comment('问卷调查标签表');

            $table->bigIncrements('id');
            $table->foreignUuid('t_key')->nullable(false)->unique();
            $table->string('name',125)->nullable(false)->unique();
            $table->integer('sort_id')->nullable()->unsigned()->default(1)->comment('排序');
            $table->text('description')->nullable()->comment('标签描述');
            $table->smallInteger('is_using')->nullable()->unsigned()->default(1)->comment('状态');
            $table->timestamps();

            $table->index('name');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down()
    : void
    {
        Schema::dropIfExists('qnr_tags');
    }
};
